﻿<Window x:Class="Probel.Ldoc.Views.ToolBoxes.CreateFileView"  
        
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:t="clr-namespace:Probel.Ldoc.Views.Properties"
        
        Title="{x:Static t:Messages.Title_CreateRecord}" 
        ResizeMode="NoResize" 
        ShowInTaskbar="False" 
        WindowStartupLocation="CenterOwner" 
        WindowStyle="ToolWindow" 
        SizeToContent="Height"
        Width="400"
        Loaded="Window_Loaded">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../Themes/Generic.xaml"/>
                <ResourceDictionary>
                    <Style TargetType="Label">
                        <Setter Property="Width" Value="90"/>
                    </Style>
                </ResourceDictionary>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>

    <DockPanel>
        <TextBlock DockPanel.Dock="Top" Margin="5"
                   Text="{x:Static t:Messages.Title_CreateRecord}" 
                   FontSize="20" 
                   Foreground="{StaticResource TaskDialogMainInstructionBrush}"/>
        <Border Style="{StaticResource ToolBoxBorderStyle}">
            <StackPanel
                    Orientation="Horizontal"
                    HorizontalAlignment="Right">
            <Button Content="{x:Static t:Messages.Btn_Ok}"
                    Style="{DynamicResource ButtonToolBoxStyle}" 
                    Command="{Binding CreateRecordCommand}"
                    Click="Click"
                    IsDefault="True"/>
            <Button Content="{x:Static t:Messages.Btn_Cancel}"
                    Style="{DynamicResource ButtonToolBoxStyle}" 
                    Command="{Binding CancelCommand}"
                    Click="Click"
                    IsCancel="True"/>
        </StackPanel>
        </Border>
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="90"/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <Label Grid.Row="0" Grid.Column="0"
                   Content="{x:Static t:Messages.Lbl_RecordName}"/>
            <Label Grid.Row="1" Grid.Column="0"
                   Content="{x:Static t:Messages.Lbl_RecordFolder}"/>
            
            <TextBox Grid.Row="0" Grid.Column="1"
                     Margin="5"
                     Text="{Binding RecordName, UpdateSourceTrigger=PropertyChanged}"/>
            <ComboBox Grid.Row="1" Grid.Column="1" ItemsSource="{Binding Folders}"
                      SelectedItem="{Binding SelectedFolder}"
                      SelectedIndex="0"
                      DisplayMemberPath="Title"
                      DockPanel.Dock="Right"                      
                      Margin="5"/>        
        </Grid>
    </DockPanel>
</Window>
